/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pt.iasd.youthshelter.pathfinder;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import pt.iasd.youthshelter.datamodel.Pathfinder;

/**
 *
 * @author Rui
 */
public class ListSorter {
    /**
     * Sort list of pathfinders by name.
     * @param pathfinders List of pathfinders.
     * @return Sorted list of pathfinders.
     */
    public static List<Pathfinder> sortPathfindersByName(List<Pathfinder> pathfinders) {
        Collections.sort(pathfinders, new Comparator<Pathfinder>() {
            @Override
            public int compare(Pathfinder o1, Pathfinder o2) {
                return o1.getName().compareTo(o1.getName());
            }
        });
        return pathfinders;
    }
}
